import request from '@/utils/request'

// 查询设备管理列表
export function listDevice(query) {
  return request({
    url: '/business/device/list',
    method: 'get',
    params: query
  })
}

// 查询设备管理详细
export function getDevice(id) {
  return request({
    url: '/business/device/' + id,
    method: 'get'
  })
}

// 新增设备管理
export function addDevice(data) {
  return request({
    url: '/business/device',
    method: 'post',
    data: data
  })
}

// 修改设备管理
export function updateDevice(data) {
  return request({
    url: '/business/device',
    method: 'put',
    data: data
  })
}

// 删除设备管理
export function delDevice(id) {
  return request({
    url: '/business/device/' + id,
    method: 'delete'
  })
}

// 查询设备管理列表不分页
export function getCurrentUserDevices() {
  return request({
    url: '/business/device/getCurrentUserDevices',
    method: 'get',
  })
}
// 统计设备在线状况信息
export function statisticsDevOnline() {
  return request({
    url: '/business/device/statisticsDevOnline',
    method: 'get',
  })
}
// 统计设备今日报警
export function statisticsTodayAlarm() {
  return request({
    url: '/business/device/statisticsTodayAlarm',
    method: 'get',
  })
}
// 统计关联用户信息
export function statisticsRelateUser(data) {
  return request({
    url: '/business/device/statisticsRelateUser?pageNum=' + data.currentPage + '&pageSize=' + data.pageSize,
    method: 'get',
  })
}


// 查询设备管理列表
export function getCurrentUserDevicesAndDatas(query) {
  return request({
    url: '/business/device/getCurrentUserDevicesAndDatas',
    method: 'get',
    params: query
  })
}

// 下达设备查询指令
export function doSendCommand(data) {
  debugger
  return request({
    url: '/business/device/doSendCommand',
    method: 'post',
    data: data
  })
}
